#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

typedef int64_t hash_t;
#define hash_ph PRId64
#define hash_mod 1000000007

hash_t str_hash(char* string) {
    hash_t hash = 1;
    int pos = 0;
    while(string[pos] != '\0') {
        hash *= 26;
        hash %= hash_mod;
        hash += string[pos] - 'a';
        hash %= hash_mod;
        pos++;
    }
    return hash;
}

int main(void) {
    while (1) {
        char string[1000];
        if (scanf("%s", string) == EOF) {
            break;
        }
        printf("%" hash_ph "\n", str_hash(string));
    }
    return 0;
}
